<%- include ('../public/page_header.ejs')%>

<div class="container-fluid">

  <div class="row">

    <div class="panel-heading">
      <a href="/<%=config.adminPath%>/focus/add" class="btn btn-primary">增加轮播</a>
    </div>


    <div class="table-responsive">
      <table class="table table-bordered">
        <thead>
          <tr class="th">
            <th>名称</th>
            <th>分类</th>
            <th>图片</th>
            <th>跳转地址</th>
            <th class="text-center">状态</th>
            <th class="text-center">排序</th>
            <th class="text-center">操作</th>
          </tr>
        </thead>
        <tbody>
          <% for(var i=0;i<focusList.length;i++) { %>
            <tr>
              <td><%= focusList[i].title %></td>
              <td><%= focusList[i].type %></td>
              <td><img src="/<%= focusList[i].focus_img %>" width="80"/></td>
              <td><%= focusList[i].link %></td>
              
              <td class="text-center">
                <% if(focusList[i].status==1) { %>
                  <img src="/static/admin/images/yes.gif" onclick="app.changeStatus(this, 'focus','status', '<%= focusList[i]._id %>', '<%=config.adminPath%>')" />
                <% } else { %>
                  <img src="/static/admin/images/no.gif" onclick="app.changeStatus(this, 'focus','status', '<%= focusList[i]._id %>', '<%=config.adminPath%>')"/>
                <% } %>
              </td>

              <td>
                <span onclick="app.editNum(this, 'focus', 'sort', '<%= focusList[i].id %>',  '<%= config.adminPath %>' )"> <%= focusList[i].sort %></span>
              </td>

              <td class="text-center">
                <a href="/<%= config.adminPath%>/focus/edit?_id=<%= focusList[i]._id %>">修改</a> 　
                <a href="/<%= config.adminPath%>/focus/delete?_id=<%= focusList[i]._id %>">删除</a>
              </td>
            </tr>

          <% } %>

        </tbody>
      </table>
        
    </div>
  </div>
</div>

</body>
</html>